//package concurrencia;
//
//import java.util.ArrayList;
//
//import comunicacion.Mensaje;
//
//import sistemaDefensivo.BateriaDeMisiles;
//
//public class MonitorDefensa {
//
////	protected SemaforoBinario lock;
////	private Semaforo locked;
////	private boolean disponible = false;
////	private int[][] matrizIncidencia = {{1,0,0,0,0,0,0,0}, 
////    									{0,1,0,0,0,0,0,0},
////										{0,0,1,0,0,0,0,0},
////										{0,0,0,1,0,0,0,0},
////										{-1,0,0,0,-1,1,0,0},
////										{0,-1,0,0,0,-1,1,0},
////										{0,0,-1,0,0,0,-1,1},
////										{0,0,0,-1,1,0,0,-1},
////										{-1,0,0,0,0,0,0,0},
////										{0,-1,0,0,0,0,0,0},
////										{0,0,-1,0,0,0,0,0},
////										{0,0,0,-1,0,0,0,0}};
//	private int[] disparaE = {1,0,0,0,-1,0,0,0,-1,0,0,0};
//	private int[] disparaN = {0,1,0,0,0,-1,0,0,0,-1,0,0};
//	private int[] disparaO = {0,0,1,0,0,0,-1,0,0,0,-1,0};
//	private int[] disparaS = {0,0,0,1,0,0,0,-1,0,0,0,-1};
//	private int[] e_s = {0,0,0,0,-1,0,0,1,0,0,0,0};
//	private int[] n_e= {0,0,0,0,1,-1,0,0,0,0,0,0};
//	private int[] o_n= {0,0,0,0,0,1,-1,0,0,0,0,0};
//	private int[] s_o= {0,0,0,0,0,0,1,-1,0,0,0,0};
//	
////						          (DE,DN,DO,DS,CE,CN,CO,CS,HE,HN,HO,HS)
//	private int[] vectorMarcado = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1};
//	
//	/*Constructor*/
//    public MonitorDefensa(ArrayList <BateriaDeMisiles> bateriasDeMisiles){
////        lock = new SemaforoBinario(1);
////        locked = new Semaforo(lock);        
//    }
//
//	public void dispararNorte(String ipRespAttk, int portRespAttk){
//		int[] marcadoAux;
//		int error = 0;
//		for(int i=0; i<12; i++){		
//			marcadoAux[i] = disparaN[i] + vectorMarcado[i];
//			if(marcadoAux[i]==-1){
//				error = 1;
//			}
//		}
//		if(error == 1){
//			this.Norte_Este();
//		}
//		else{
//			vectorMarcado = marcadoAux;
//			
////			FALTA SUSPENDER LA BATERIA X TIEMPO
//			
//		}
//	}
//		
//	public void Norte_Este(){
//		int[] marcadoAux;
//		for(int i=0; i<12; i++){		
//			marcadoAux[i] = disparaN[i] + vectorMarcado[i];
//
//			}
//		}
//	}
//		
//		
//	
////		if(isUsed())
////			locked.DELAY();
////
////		setUsed(true);
////		posEnemigos.add(PE);
////		setUsed(false);
////		locked.RESUME();
////
////	}
////	
////	public void removePosEnemigo(int id){
////		if(isUsed())
////			locked.DELAY();
////
////		setUsed(true);
////		
////		for(int i=0; i<posEnemigos.size(); i++){
////			if(posEnemigos.get(i).getId() == id)
////				posEnemigos.remove(i);
////		}			
////		setUsed(false);
////		locked.RESUME();
////	}
////	
////	public void setPosEnemigo(int id, double x, double y, double z, double xDest, double yDest, double zDest){
////		if(isUsed())
////			locked.DELAY();
////		setUsed(true);
////		for(int i=0; i<posEnemigos.size(); i++){
////			if(posEnemigos.get(i).getId() == id){
////				posEnemigos.get(i).setX(x);
////				posEnemigos.get(i).setY(y);
////				posEnemigos.get(i).setZ(z);
////				posEnemigos.get(i).setXDest(xDest);
////				posEnemigos.get(i).setYDest(yDest);
////				posEnemigos.get(i).setZDest(zDest);
////			}
////		}		
////		setUsed(false);
////		locked.RESUME();
////	}
////	  
////    public int getSizeposEnemigos(){
////    	return posEnemigos.size();
////    }
////    
////	public IdPosicion getPosEnemigo(int pos){
////		return posEnemigos.get(pos);
////	}
////	
////	public int getIndexOfPosEnemigo(IdPosicion PE){
////		return posEnemigos.indexOf(PE);
////	}
//}
